package com.sie.zhq.bean;

public class APDU_SEND {
    public byte[] Command = new byte[4];
    public byte[] DataIn = new byte[2048];
    public short Lc;
    public short Le;

    public APDU_SEND() {
    }

    public APDU_SEND(byte[] Command, short Lc, byte[] DataIn, short Le) {
        this.Command = Command;
        this.Lc = Lc;
        this.DataIn = DataIn;
        this.Le = Le;
    }

    public byte[] toBytesArray() {
        byte[] apduSend = new byte[100];
        System.arraycopy(this.Command,0,apduSend,0,4);
        apduSend[4]=(byte)(this.Lc / 256);
        apduSend[5]=(byte)(this.Lc % 256);
        System.arraycopy(this.DataIn,0,apduSend,6,this.DataIn.length);
        apduSend[this.DataIn.length+7]=(byte) (this.Le / 256);
        apduSend[this.DataIn.length+8]=(byte) (this.Le % 256);
        return  apduSend;
    }
}